package sample.actor.path;

import akka.actor.UntypedActor;

public class EchoActor2 extends UntypedActor {
	@Override
	public void onReceive(Object message) throws Exception {
		if(message instanceof String){
			if("2".equals(message)) {
				System.out.println(this.getClass().getName()+"--->"+message);
				getSelf().tell("1", getSender());
			}else if("3".equals(message)){
				System.out.println(this.getClass().getName()+"--->"+message);
				getSender().tell(Integer.valueOf(message.toString())-1, getSelf());

			}else{
				unhandled(message);
			}
		}

	}
}
